package cn.edu.njust.server;

import lombok.ToString;

import java.util.concurrent.atomic.AtomicInteger;

@ToString
public class Stat {
    private AtomicInteger backlog = new AtomicInteger(0);

    private long lastLatency;

    public int getBacklog() {
        return backlog.get();
    }

    public int getBacklogAndIncrement() {
        return this.backlog.getAndIncrement();
    }

    public int getBacklogAndDecrement() {
        return this.backlog.getAndDecrement();
    }

    public long getLastLatency() {
        return lastLatency;
    }

    public void setLastLatency(long lastLatency) {
        this.lastLatency = lastLatency;
    }
}